package com.example.demo.service.impl;

import com.example.demo.controller.PersonnelController;
import com.example.demo.entity.*;
import com.example.demo.mysqlDao.MysDao;
import com.example.demo.oracleDao.OrcalDao;
import com.example.demo.service.OraService;
import com.example.demo.util.UuidUtil;
import org.apache.commons.lang.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.EnableTransactionManagement;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.text.SimpleDateFormat;
import java.time.LocalDateTime;
import java.util.*;
import java.util.stream.Collectors;

@Service
@EnableTransactionManagement
public class OraServiceImpl implements OraService {

    private static final Logger LOG = LoggerFactory.getLogger(OraServiceImpl.class);

    @Resource
    private OrcalDao orcaldao;

    @Resource
    private MysDao mysDao;

    @Resource
    private OraService OraService;


    //以下按当天时间查各个表的总数据
    @Override
    public Map<String, Object> OraAlarmitems() {
        List<Alarmitems> resultOracle = orcaldao.OraAlarmitems();
        Map<String, Object> data = new HashMap<>();
        if(resultOracle.size() == 0){
            data.put("OracleList", "没有数据");
            LOG.info("该条没数据---");
        }else {
            mysDao.insertAlarmitems(resultOracle);
            data.put("OracleList", resultOracle);
        }
        System.out.println("结果："+data);
        return data;
    }

    @Override
    public Map<String, Object> OraBasicinfo() {
        List<Basicinfo> resultOracle = orcaldao.OraBasicinfo();
        Map<String, Object> data = new HashMap<>();
        if(resultOracle.size() == 0){
            data.put("OracleList", "没有数据");
            LOG.info("该条没数据---");
        }else {
            mysDao.insertBasicinfo(resultOracle);
            data.put("OracleList", resultOracle);
        }
        System.out.println("结果："+data);
        return data;
    }

    @Override
    public Map<String, Object> OraCheckcar() {
        List<Checkcar> resultOracle = orcaldao.OraCheckcar();
        Map<String, Object> data = new HashMap<>();
        if(resultOracle.size() == 0){
            data.put("OracleList", "没有数据");
            LOG.info("该条没数据---");
        }else {
            mysDao.insertCheckcar(resultOracle);
            data.put("OracleList", resultOracle);
        }
        System.out.println("结果："+data);
        return data;
    }

    @Override
    public Map<String, Object> OraChecksize() {
        List<Checksize> resultOracle = orcaldao.OraChecksize();
        Map<String, Object> data = new HashMap<>();
        if(resultOracle.size() == 0){
            data.put("OracleList", "没有数据");
            LOG.info("该条没数据---");
        }else {
            mysDao.insertChecksize(resultOracle);
            data.put("OracleList", resultOracle);
        }
        System.out.println("结果："+data);
        return data;
    }

    @Override
    public Map<String, Object> OraCheckwheelscar() {
        List<Checkwheelscar> resultOracle = orcaldao.OraCheckwheelscar();
        Map<String, Object> data = new HashMap<>();
        if(resultOracle.size() == 0){
            data.put("OracleList", "没有数据");
            LOG.info("该条没数据---");
        }else {
            mysDao.insertCheckwheelscar(resultOracle);
            data.put("OracleList", resultOracle);
        }
        System.out.println("结果："+data);
        return data;
    }

    @Override
    public Map<String, Object> OraOverdemarcationrecord() {
        List<Overdemarcationrecord> resultOracle = orcaldao.OraOverdemarcationrecord();
        Map<String, Object> data = new HashMap<>();
        if(resultOracle.size() == 0){
            data.put("OracleList", "没有数据");
            LOG.info("该条没数据---");
        }else {
            mysDao.insertOverdemarcationrecord(resultOracle);
            data.put("OracleList", resultOracle);
        }
        System.out.println("结果："+data);
        return data;
    }

    @Override
    public Map<String, Object> OraJczb() {
        List<Jczb> resultOracle = orcaldao.OraJczb();
        Map<String, Object> data = new HashMap<>();
        if(resultOracle.size() == 0){
            data.put("OracleList", "没有数据");
            LOG.info("该条没数据---");
        }else {
            mysDao.insertJczb(resultOracle);
            data.put("OracleList", resultOracle);
        }
        System.out.println("结果："+data);
        return data;
    }


    //以下是按照行数来分页查各个的数据，并存入mysql
    @Override
//    @Transactional
    public Map<String, Object> OraAlarmitemsPage() {
        //全量导入前清空mysql中对应的表
        Map params = new HashMap();
        params.put("MaxTime","");
        params.put("MinTime","");
        mysDao.deleteAlarmitems(params);
        //总行数，方便计算循环几次导入
        int counts = orcaldao.OraAlarmitemsCounts();

        int nums = 10000;
        int number = counts%nums==0?counts/nums:counts/nums+1;

        for(int i=0; i<number; i++){
            params.put("size",i*nums);
            params.put("page",nums*(1+i));
            //分页查到的数据
            List<Alarmitems> list = orcaldao.OraAlarmitemsPage(params);
            if(list.size() == 0){
                LOG.info("该条没数据---");
            }
            //把分页查到的数据导入mysql中对应的表
            mysDao.insertAlarmitems(list);
        }

        //添加同步记录
        SynRecord synRecord = new SynRecord();
        synRecord.setMonitoringId(UuidUtil.getUUid());
        synRecord.setSynType(2);//同步类型：1 增量同步 2 全量同步
        synRecord.setSynCount(counts);
        synRecord.setTableName("V_LD_ALARMITEMS");//视图名
        synRecord.setMonitoringTime(dateFormat.format(new Date()));
        this.mysDao.insertSynRecord(synRecord);
        Map map = new HashMap();

        return map;
    }

    @Override
    public Map<String, Object> OraBasicinfoPage() {
        //全量导入前清空mysql中对应的表
        Map params = new HashMap();
        params.put("MaxTime","");
        params.put("MinTime","");
        mysDao.deleteBasicinfo(params);
        //总行数，方便计算循环几次导入
        int counts = orcaldao.OraBasicinfoCounts();
        int nums = 10000;
        int number = counts%nums==0?counts/nums:counts/nums+1;

        for(int i=0; i<number; i++){
            params.put("size",i*nums);
            params.put("page",nums*(1+i));
            //分页查到的数据
            List<Basicinfo> list = orcaldao.OraBasicinfoPage(params);
            if(list.size() != 0){
                LOG.info("该条没数据---");
            }
            //把分页查到的数据导入mysql中对应的表
            mysDao.insertBasicinfo(list);


        }
        //添加同步记录
        SynRecord synRecord = new SynRecord();
        synRecord.setMonitoringId(UuidUtil.getUUid());
        synRecord.setSynType(2);//同步类型：1 增量同步 2 全量同步
        synRecord.setSynCount(counts);
        synRecord.setTableName("V_LD_BASICINFO");//视图名
        synRecord.setMonitoringTime(dateFormat.format(new Date()));
        this.mysDao.insertSynRecord(synRecord);

        return null;
    }

    @Override
    public Map<String, Object> OraCheckcarPage() {
        Map params = new HashMap();
        params.put("MaxTime","");
        params.put("MinTime","");
        //全量导入前清空mysql中对应的表
        mysDao.deleteCheckcar(params);
        //总行数，方便计算循环几次导入
        int counts = orcaldao.OraCheckcarCounts();
        int nums = 10000;
        int number = counts%nums==0?counts/nums:counts/nums+1;

        for(int i=0; i<number; i++){
            params.put("size",i*nums);
            params.put("page",nums*(1+i));
            //分页查到的数据
            List<Checkcar> list = orcaldao.OraCheckcarPage(params);
            if(list.size() != 0){
                LOG.info("该条没数据---");
            }
            //把分页查到的数据导入mysql中对应的表
            mysDao.insertCheckcar(list);
        }

        //添加同步记录
        SynRecord synRecord = new SynRecord();
        synRecord.setMonitoringId(UuidUtil.getUUid());
        synRecord.setSynType(2);//同步类型：1 增量同步 2 全量同步
        synRecord.setSynCount(counts);
        synRecord.setTableName("V_LD_CHECKCAR");//视图名
        synRecord.setMonitoringTime(dateFormat.format(new Date()));
        this.mysDao.insertSynRecord(synRecord);


        return null;
    }

    @Override
    public Map<String, Object> OraChecksizePage() {
        Map params = new HashMap();
        params.put("MaxTime","");
        params.put("MinTime","");
        //全量导入前清空mysql中对应的表
        mysDao.deleteChecksize(params);
        //总行数，方便计算循环几次导入
        int counts = orcaldao.OraChecksizeCounts();
        int nums = 10000;
        int number = counts%nums==0?counts/nums:counts/nums+1;

        for(int i=0; i<number; i++){
            params.put("size",i*nums);
            params.put("page",nums*(1+i));
            //分页查到的数据
            List<Checksize> list = orcaldao.OraChecksizePage(params);
            if(list.size() != 0){
                LOG.info("该条没数据---");
            }
            //把分页查到的数据导入mysql中对应的表
            mysDao.insertChecksize(list);
        }

        //添加同步记录
        SynRecord synRecord = new SynRecord();
        synRecord.setMonitoringId(UuidUtil.getUUid());
        synRecord.setSynType(2);//同步类型：1 增量同步 2 全量同步
        synRecord.setSynCount(counts);
        synRecord.setTableName("V_LD_CHECKSIZE");//视图名
        synRecord.setMonitoringTime(dateFormat.format(new Date()));
        this.mysDao.insertSynRecord(synRecord);

        return null;
    }

    @Override
    public Map<String, Object> OraCheckwheelscarPage() {
        Map params = new HashMap();
        params.put("MaxTime","");
        params.put("MinTime","");
        //全量导入前清空mysql中对应的表 Checkwheelscar
        mysDao.deleteCheckwheelscar(params);
        //总行数，方便计算循环几次导入
        int counts = orcaldao.OraCheckwheelscarCounts();
        int nums = 10000;
        int number = counts%nums==0?counts/nums:counts/nums+1;

        for(int i=0; i<number; i++){
            params.put("size",i*nums);
            params.put("page",nums*(1+i));
            //分页查到的数据
            List<Checkwheelscar> list = orcaldao.OraCheckwheelscarPage(params);
            if(list.size() != 0){
                LOG.info("该条没数据---");
            }
            //把分页查到的数据导入mysql中对应的表
            mysDao.insertCheckwheelscar(list);
        }

        //添加同步记录
        SynRecord synRecord = new SynRecord();
        synRecord.setMonitoringId(UuidUtil.getUUid());
        synRecord.setSynType(2);//同步类型：1 增量同步 2 全量同步
        synRecord.setSynCount(counts);
        synRecord.setTableName("V_LD_CHECKWHEELSCAR");//视图名
        synRecord.setMonitoringTime(dateFormat.format(new Date()));
        this.mysDao.insertSynRecord(synRecord);

        return null;
    }

    @Override
    public Map<String, Object> OraOverdemarcationrecordPage() {
        Map params = new HashMap();
        params.put("MaxTime","");
        params.put("MinTime","");
        //全量导入前清空mysql中对应的表
        mysDao.deleteOverdemarcationrecord(params);
        //总行数，方便计算循环几次导入
        int counts = orcaldao.OraOverdemarcationrecordCounts();
        int nums = 10000;
        int number = counts%nums==0?counts/nums:counts/nums+1;

        for(int i=0; i<number; i++){
            params.put("size",i*nums);
            params.put("page",nums*(1+i));
            //分页查到的数据
            List<Overdemarcationrecord> list = orcaldao.OraOverdemarcationrecordPage(params);
            if(list.size() != 0){
                LOG.info("该条没数据---");
            }
            //把分页查到的数据导入mysql中对应的表
            mysDao.insertOverdemarcationrecord(list);
        }


        //添加同步记录
        SynRecord synRecord = new SynRecord();
        synRecord.setMonitoringId(UuidUtil.getUUid());
        synRecord.setSynType(2);//同步类型：1 增量同步 2 全量同步
        synRecord.setSynCount(counts);
        synRecord.setTableName("V_LD_OVERDEMARCATIONRECORD");//视图名
        synRecord.setMonitoringTime(dateFormat.format(new Date()));
        this.mysDao.insertSynRecord(synRecord);
        return null;
    }

    @Override
    public Map<String, Object> OraJczbPage() {
        Map params = new HashMap();
        params.put("MaxTime","");
        params.put("MinTime","");
        //全量导入前清空mysql中对应的表
        mysDao.deleteJczb(params);
        //总行数，方便计算循环几次导入
        int counts = orcaldao.OraJczbCounts();
        int nums = 10000;
        int number = counts%nums==0?counts/nums:counts/nums+1;

        for(int i=0; i<number; i++){
            params.put("size",i*nums);
            params.put("page",nums*(1+i));
            //分页查到的数据
            List<Jczb> list = orcaldao.OraJczbPage(params);
            if(list.size() != 0){
                LOG.info("该条没数据---");
            }
            //把分页查到的数据导入mysql中对应的表
            mysDao.insertJczb(list);
        }

        //添加同步记录
        SynRecord synRecord = new SynRecord();
        synRecord.setMonitoringId(UuidUtil.getUUid());
        synRecord.setSynType(2);//同步类型：1 增量同步 2 全量同步
        synRecord.setSynCount(counts);
        synRecord.setTableName("RK_VV_XA_JCZB_JT6");//视图名
        synRecord.setMonitoringTime(dateFormat.format(new Date()));
        this.mysDao.insertSynRecord(synRecord);
        return null;
    }


    //以下是。。。
    SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
    String createTime = dateFormat.format(new Date());
    @Override
    public Map<String, Object> OraAlarmitemsPageMax() {
        Map<String, Object> data = new HashMap<>();
        String maxTime = mysDao.selectAlarmitemsMaxTime();
        if(maxTime==null){
            OraService.OraAlarmitemsPage();
        }else {

            Map params = new HashMap();

            params.put("MaxTime",createTime);
            params.put("MinTime",maxTime);
            params.put("oraMaxTime",maxTime);
            //全量导入前清空mysql中对应的表
            int deleteAlarmitems = mysDao.deleteAlarmitems(params);
            List<Alarmitems> list = orcaldao.OraAlarmitemsPageMax(params);

            if(list.size() == 0){
                LOG.info("该V_LD_ALARMITEMS视图条没增量数据---");
                data.put("maxTiemList","该V_LD_ALARMITEMS视图条没增量数据---");
            } else {
                //把分页查到的数据导入mysql中对应的表
                mysDao.insertAlarmitems(list);
                //添加同步记录
                SynRecord synRecord = new SynRecord();
                synRecord.setMonitoringId(UuidUtil.getUUid());
                synRecord.setSynType(1);//同步类型：1 增量同步 2 全量同步
                if (deleteAlarmitems != list.size()){
                    synRecord.setSynCount(list.size());
                    List<String> datas = list.stream().map(p -> p.getID()).collect(Collectors.toList());
                    synRecord.setSynData(StringUtils.join(datas,","));
                }else {
                    synRecord.setSynCount(0);
                }

                synRecord.setTableName("V_LD_ALARMITEMS");//视图名
                synRecord.setMonitoringTime(dateFormat.format(new Date()));
                this.mysDao.insertSynRecord(synRecord);
                data.put("maxTiemList",list);
            }
        }
        return data;
    }




    @Override
    public Map<String, Object> OraBasicinfoPageMax() {
        String maxTime = mysDao.selectBasicinfoMaxTime();
        Map<String, Object> data = new HashMap<>();
        if(maxTime==null){
            OraService.OraBasicinfoPage();
        }else {

            Map params = new HashMap();

            params.put("MaxTime",createTime);
            params.put("MinTime",maxTime);
            params.put("oraMaxTime", maxTime);
            //全量导入前清空mysql中对应的表
            int deleteBasicinfo = mysDao.deleteBasicinfo(params);
            List<Basicinfo> list = orcaldao.OraBasicinfoPageMax(params);
            if (list.size() == 0) {
                LOG.info("该V_LD_BASICINFO视图条没增量数据---");
                data.put("maxTiemList", "该V_LD_BASICINFO视图条没增量数据---");
            } else {
                //把分页查到的数据导入mysql中对应的表
                mysDao.insertBasicinfo(list);

                //添加同步记录
                SynRecord synRecord = new SynRecord();
                synRecord.setMonitoringId(UuidUtil.getUUid());
                synRecord.setSynType(1);//同步类型：1 增量同步 2 全量同步
                if (deleteBasicinfo != list.size()){
                    synRecord.setSynCount(list.size());
                    List<String> datas = list.stream().map(p -> p.getID()).collect(Collectors.toList());
                    synRecord.setSynData(StringUtils.join(datas,","));
                }else {
                    synRecord.setSynCount(0);
                }
                synRecord.setTableName("V_LD_BASICINFO");//视图名
                synRecord.setMonitoringTime(dateFormat.format(new Date()));
                this.mysDao.insertSynRecord(synRecord);
                data.put("maxTiemList", list);
            }
        }
        return data;
    }

    @Override
    public Map<String, Object> OraCheckcarPageMax() {
        String maxTime = mysDao.selectCheckcarMaxTime();
        Map<String, Object> data = new HashMap<>();
        if(maxTime==null){
            OraService.OraCheckcarPage();
        }else {

            Map params = new HashMap();

            params.put("MaxTime",createTime);
            params.put("MinTime",maxTime);
            params.put("oraMaxTime", maxTime);
            //全量导入前清空mysql中对应的表
            int deleteCheckcar = mysDao.deleteCheckcar(params);
            List<Checkcar> list = orcaldao.OraCheckcarPageMax(params);
            if (list.size() == 0) {
                LOG.info("该V_LD_CHECKCAR视图条没增量数据---");
                data.put("maxTiemList", "该V_LD_CHECKCAR视图条没增量数据---");
            } else {
                //把分页查到的数据导入mysql中对应的表
                mysDao.insertCheckcar(list);

                //添加同步记录
                SynRecord synRecord = new SynRecord();
                synRecord.setMonitoringId(UuidUtil.getUUid());
                synRecord.setSynType(1);//同步类型：1 增量同步 2 全量同步
                if (deleteCheckcar != list.size()){
                    synRecord.setSynCount(list.size());
                    List<String> datas = list.stream().map(p -> p.getID()).collect(Collectors.toList());
                    synRecord.setSynData(StringUtils.join(datas,","));
                }else {
                    synRecord.setSynCount(0);
                }
                synRecord.setTableName("V_LD_CHECKCAR");//视图名
                synRecord.setMonitoringTime(dateFormat.format(new Date()));
                this.mysDao.insertSynRecord(synRecord);
                data.put("maxTiemList", list);
            }
        }
        return data;
    }

    @Override
    public Map<String, Object> OraChecksizePageMax() {
        String maxTime = mysDao.selectChecksizeMaxTime();
            Map<String, Object> data = new HashMap<>();
            if(maxTime==null){
                OraService.OraChecksizePage();
            }else {

                Map params = new HashMap();

                params.put("MaxTime",createTime);
                params.put("MinTime",maxTime);
                params.put("oraMaxTime", maxTime);
                //全量导入前清空mysql中对应的表
                int deleteChecksize = mysDao.deleteChecksize(params);
                List<Checksize> list = orcaldao.OraChecksizePageMax(params);
                if (list.size() == 0) {
                    LOG.info("该V_LD_CHECKSIZE视图条没增量数据---");
                    data.put("maxTiemList", "该V_LD_CHECKSIZE视图条没增量数据---");
                } else {
                    //把分页查到的数据导入mysql中对应的表
                    mysDao.insertChecksize(list);

                    //添加同步记录
                    SynRecord synRecord = new SynRecord();
                    synRecord.setMonitoringId(UuidUtil.getUUid());
                    synRecord.setSynType(1);//同步类型：1 增量同步 2 全量同步
                    if (deleteChecksize != list.size()){
                        synRecord.setSynCount(list.size());
                        List<String> datas = list.stream().map(p -> p.getID()).collect(Collectors.toList());
                        synRecord.setSynData(StringUtils.join(datas,","));
                    }else {
                        synRecord.setSynCount(0);
                    }
                    synRecord.setTableName("V_LD_CHECKSIZE");//视图名
                    synRecord.setMonitoringTime(dateFormat.format(new Date()));
                    this.mysDao.insertSynRecord(synRecord);
                    data.put("maxTiemList", list);
                }
            }
        return data;
    }

    @Override
    public Map<String, Object> OraCheckwheelscarPageMax() {
        String maxTime = mysDao.selectCheckwheelscarMaxTime();
        Map<String, Object> data = new HashMap<>();
        if(maxTime==null){
            OraService.OraCheckwheelscarPage();
        }else {

            Map params = new HashMap();

            params.put("MaxTime",createTime);
            params.put("MinTime",maxTime);
            params.put("oraMaxTime", maxTime);
            //全量导入前清空mysql中对应的表
            int deleteCheckwheelscar = mysDao.deleteCheckwheelscar(params);
            List<Checkwheelscar> list = orcaldao.OraCheckwheelscarPageMax(params);
            if (list.size() == 0) {
                LOG.info("该V_LD_CHECKWHEELSCAR视图条没增量数据---");
                data.put("maxTiemList", "该V_LD_CHECKWHEELSCAR视图条没增量数据---");
            } else {
                //把分页查到的数据导入mysql中对应的表
                mysDao.insertCheckwheelscar(list);

                //添加同步记录
                SynRecord synRecord = new SynRecord();
                synRecord.setMonitoringId(UuidUtil.getUUid());
                synRecord.setSynType(1);//同步类型：1 增量同步 2 全量同步
                if (deleteCheckwheelscar != list.size()){
                    synRecord.setSynCount(list.size());
                    List<String> datas = list.stream().map(p -> p.getID()).collect(Collectors.toList());
                    synRecord.setSynData(StringUtils.join(datas,","));
                }else {
                    synRecord.setSynCount(0);
                }
                synRecord.setTableName("V_LD_CHECKWHEELSCAR");//视图名
                synRecord.setMonitoringTime(dateFormat.format(new Date()));
                this.mysDao.insertSynRecord(synRecord);
                data.put("maxTiemList", list);
            }
        }
        return data;
    }

    @Override
    public Map<String, Object> OraOverdemarcationrecordPageMax() {
        String maxTime = mysDao.selectOverdemarcationrecordMaxTime();
        Map<String, Object> data = new HashMap<>();
        if(maxTime==null){
            OraService.OraOverdemarcationrecordPage();
        }else {

            Map params = new HashMap();

            params.put("MaxTime",createTime);
            params.put("MinTime",maxTime);
            params.put("oraMaxTime", maxTime);
            //全量导入前清空mysql中对应的表
            int deleteOverdemarcationrecord = mysDao.deleteOverdemarcationrecord(params);
            List<Overdemarcationrecord> list = orcaldao.OraOverdemarcationrecordPageMax(params);
            if (list.size() == 0) {
                LOG.info("该V_LD_OVERDEMARCATIONRECORD视图条没增量数据---");
                data.put("maxTiemList", "该V_LD_OVERDEMARCATIONRECORD视图条没增量数据---");
            } else {
                //把分页查到的数据导入mysql中对应的表
                mysDao.insertOverdemarcationrecord(list);
                //添加同步记录
                SynRecord synRecord = new SynRecord();
                synRecord.setMonitoringId(UuidUtil.getUUid());
                synRecord.setSynType(1);//同步类型：1 增量同步 2 全量同步
                if (deleteOverdemarcationrecord != list.size()){
                    synRecord.setSynCount(list.size());
                    List<String> datas = list.stream().map(p -> p.getID()).collect(Collectors.toList());
                    synRecord.setSynData(StringUtils.join(datas,","));
                }else {
                    synRecord.setSynCount(0);
                }
                synRecord.setTableName("V_LD_OVERDEMARCATIONRECORD");//视图名
                synRecord.setMonitoringTime(dateFormat.format(new Date()));
                this.mysDao.insertSynRecord(synRecord);

                data.put("maxTiemList", list);
            }
        }
        return data;
    }

    @Override
    public Map<String, Object> OraJczbPageMax() {
        String maxTime = mysDao.selectJczbMaxTime();
        Map<String, Object> data = new HashMap<>();
        if(maxTime==null){
            OraService.OraJczbPage();
        }else {

            Map params = new HashMap();

            params.put("MaxTime",createTime);
            params.put("MinTime",maxTime);
            params.put("oraMaxTime", maxTime);
            //全量导入前清空mysql中对应的表
            int deleteJczb = mysDao.deleteJczb(params);
            List<Jczb> list = orcaldao.OraJczbPageMax(params);
            if (list.size() == 0) {
                LOG.info("该RK_VV_XA_JCZB_JT6表条没增量数据---");
                data.put("maxTiemList", "该RK_VV_XA_JCZB_JT6视图条没增量数据---");
            } else {
                //把分页查到的数据导入mysql中对应的表
                mysDao.insertJczb(list);
                //添加同步记录
                SynRecord synRecord = new SynRecord();
                synRecord.setMonitoringId(UuidUtil.getUUid());
                synRecord.setSynType(1);//同步类型：1 增量同步 2 全量同步
                if (deleteJczb != list.size()){
                    synRecord.setSynCount(list.size());
                    List<String> datas = list.stream().map(p -> p.getDB_ID()).collect(Collectors.toList());
                    synRecord.setSynData(StringUtils.join(datas,","));
                }else {
                    synRecord.setSynCount(0);
                }
                synRecord.setTableName("RK_VV_XA_JCZB_JT6");//视图名
                synRecord.setMonitoringTime(dateFormat.format(new Date()));
                this.mysDao.insertSynRecord(synRecord);
                data.put("maxTiemList", list);
            }
        }
        return data;
    }



}
